<template>
	<view class="page">
		<view class="card">
			<view class="title">
				<view class="date">高级编程</view>
				<!-- <view class="todayClass">今日课程</view> -->
			</view>
			<button class="location">定位</button>

			<image class="upload" :src=img @click="uploadImg" mode=""></image>
			<view>请上传自拍</view>
			<!-- <view class="upload">
				<uni-file-picker v-model="imageValue" fileMediatype="image" mode="grid" limit="1" title="最多选择1张图片" />
			</view> -->
			<button class="qiandao" @tap="goDetail">确认签到</button>
		</view>
		<view v-if="ifError" class="tanchuang">{{errorMessage}}</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				img: '../../static/images/upload.png',
				imageValue: [],
				errorMessage: '请重新拍照!',
				ifError: true
			}
		},
		onLoad() {

		},
		methods: {
			select(e) {
				console.log('选择文件：', e)
			},
			// 获取上传进度
			progress(e) {
				console.log('上传进度：', e)
			},

			// 上传成功
			success(e) {
				console.log('上传成功')
			},

			// 上传失败
			fail(e) {
				console.log('上传失败：', e)
			},
			uploadImg() {
				let that = this
				uni.chooseImage({
					success(res) {
						console.log(res.tempFilePaths)
						that.img = res.tempFilePaths[0];
						console.log(that.imgArr)
					}
				})
			}
		}
	}
</script>


<style>
	.page {
		display: flex;
		flex-direction: column;
	}

	.tanchuang {
		margin: 50rpx auto;
		width: 298px;
		height: 36px;
		line-height: 36px;
		border-radius: 40px 40px 40px 40px;
		background-color: rgba(255, 253, 246, 1);
		color: rgba(0, 0, 0, 1.0);
		font-size: 14px;
		text-align: center;
		font-family: Arial;
		border: 1px solid rgba(187, 187, 187, 1);
	}

	.select {
		margin-top: 20rpx;
		margin-left: 80rpx;

	}

	.upload {
		margin: 50rpx auto;
		width: 171px;
		height: 171px;
		border-radius: 4px 4px 4px 4px;
		background-color: rgba(0, 0, 0, 0);
		text-align: center;
		border: 1px solid rgba(0, 0, 0, 0);
	}

	.location {
		/* left: 110px;
		top: 333px; */
		margin-top: 50rpx;
		width: 171px;
		height: 36px;
		line-height: 36px;
		border-radius: 40px 40px 40px 40px;
		background-color: rgba(196, 149, 125, 1);
		color: rgba(236, 235, 230, 1);
		font-size: 20px;
		text-align: center;
		font-family: Arial;
		border: 1px solid rgba(187, 187, 187, 1);
		letter-spacing: 25rpx;
	}

	.qiandao {
		/* left: 70px; */
		/* top: 598px; */
		/* margin-top: 20rpx; */
		margin-top: 50rpx;
		width: 252px;
		height: 55px;
		line-height: 55px;
		border-radius: 40px 40px 40px 40px;
		background-color: rgba(72, 73, 68, 1);
		color: rgba(236, 235, 230, 1);
		font-size: 20px;
		text-align: center;
		font-family: Arial;
		border: 1px solid rgba(187, 187, 187, 1);
		letter-spacing: 30rpx;
	}

	.title {
		/* left: 47px;
		top: 134px; */
		width: 298px;
		height: 100px;
		line-height: 20px;
		border-radius: 20px 20px 0px 0px;
		background-color: rgba(196, 149, 125, 1);
		color: rgba(16, 16, 16, 1);
		font-size: 14px;
		text-align: center;
		box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.4);
		font-family: Arial;
		border: 1px solid rgba(187, 187, 187, 1);
		display: flex;
		flex-direction: column;
	}

	.date {
		/* left: 111px;
		top: 175px;
		width: 171px;
		height: 40px; */
		margin: auto;
		color: rgba(255, 253, 246, 1);
		font-size: 28px;
		text-align: left;
		font-family: PingFangSC-regular;
	}

	.todayClass {
		margin: auto;
		/* left: 155px;
		top: 232px;
		width: 80px;
		height: 28px; */
		color: rgba(255, 253, 246, 1);
		font-size: 20px;
		text-align: left;
		font-family: PingFangSC-regular;
	}

	.card {
		margin: auto;
		/* left: 47px;
		top: 134rpx; */
		width: 298px;
		height: 530px;
		margin-top: 50rpx;
		/* line-height: 20px; */
		border-radius: 20px 20px 20px 20px;
		background-color: rgba(246, 244, 239, 1);
		color: rgba(16, 16, 16, 1);
		font-size: 14px;
		text-align: center;
		box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.4);
		font-family: Arial;
		border: 1px solid rgba(187, 187, 187, 1);
		display: flex;
		flex-direction: column;
	}

	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
</style>